package com.two.lbms.hjx.controller;

import com.two.lbms.base.BaseController;
import com.two.lbms.base.ResultInfo;
import com.two.lbms.hjx.model.IllegalQuery;
import com.two.lbms.hjx.service.IllegalService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author hjx
 * @version V1.0
 * @Date 2023/7/31 17:57
 */
@RestController
@RequestMapping("/illegal")
public class IllegalController extends BaseController {

    @Resource
    private IllegalService illegalService;

    @GetMapping("list")
    public Map<String, Object> illegalList(IllegalQuery illegalQuery){
        return illegalService.queryByParamsForTable(illegalQuery);
    }
    @PostMapping("add")
    public ResultInfo  illegalAdd(IllegalQuery illegalQuery){
        illegalService.addIllegal(illegalQuery);
        return success();
    }
    @PutMapping("update")
    public ResultInfo  illegalUpdate(IllegalQuery illegalQuery){
        illegalService.updateIllegal(illegalQuery);
        return success();
    }
    @DeleteMapping("delete")
    public ResultInfo illegalDelete(Integer id){
        illegalService.deleteIllegal(id);
        return success();
    }
    @DeleteMapping("deleteBatch")
    public ResultInfo illegalDeleteBatch(Integer[] ids){
        illegalService.deleteIllegalBatch(ids);
        return success();
    }


}
